<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定长子串中元音的最大数目</title>
</head>
<body>
  <script>
    function fn(s, k) {
      let hash = new Set(['a', 'e', 'i', 'o', 'u'])
      let n = s.length;
      let left = 0, right = 0
      let count = 0
      while (right < k) {
        hash.has(s[right++]) && count++
      }
      let res = count
      while (right < n) {
        hash.has(s[right++]) && count++
        hash.has(s[left++]) && count--
        res = Math.max(res, count);
      }
      return res
    }
    console.log(fn('abciiidef', 3))
  </script>
</body>
</html>